<?php

$menu = $variables[NULL]['#content'];
global $base_url;
?>

<!--pc 二级三级导航-->
<nav class="mod mod-nav-sub js-mod-nav-sub " data-connectors="navsticky,search,greybox,overlay">
  <div class="container">
    <ul class="sub clearfix">
      <?php
      $i = 0;
      foreach ($menu as $item) {
        if ($item['#title']) {
          ?>
          <li>
            <a href="<?= $item['#href'] == 'education/spf-overview' ? url('education').'#education-course': url($item['#href'],$item["#localized_options"]) ?>"
               class="b-secondary js-sub-link"><?= $item['#title'] ?></a>
            <?php if (!empty($item['#below'])) {
              ?>
              <div class="sub-sub" style="display: none;">
                <div class="nav-row clearfix g-row g-layout-nav-sub">
                  <?php
                  foreach ($item['#below'] as $belowItem) { ?>
                    <div class="grid_4 g-col">
                      <ul>
                        <li class="main">
                          <a href="<?= !empty($belowItem['#href']) ? url($belowItem['#href'],$belowItem["#localized_options"]) : '#' ?>"><?= $belowItem['#title'] ?></a>
                        </li>
                        <?php
                        if (!empty($belowItem['#below'])) {
                          foreach ($belowItem['#below'] as $belowItem1) { ?>
                            <li>
                              <a href="<?= !empty($belowItem1['#href']) ? url($belowItem1['#href'],$belowItem1["#localized_options"]) : '#' ?>"><?= $belowItem1['#title'] ?></a>
                            </li>
                            <?php
                          }
                        } ?>

                      </ul>
                    </div>
                    <?php
                  } ?>
                </div>
              </div>
              <?php
            } ?>
          </li>
          <?php
        }
      } ?>
    </ul>
  </div>
</nav>